package com.dycong.common.threadUtil;

import lombok.experimental.Delegate;

import javax.annotation.PreDestroy;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * Created by dycong on 2016/11/16.
 */
// TODO: 2016/11/17 这些都需要在main()方法运行，创建POOL实例，Junit是单元测试，不适合在这里测试，不靠谱，处理不好关联关系吧？！
//public class ThreadPoolService implements ExecutorService{
public class ThreadPoolService{

    public static final int DEFAULT_SIZE = 10;

    @Delegate
    ExecutorService  executorService = Executors.newFixedThreadPool(DEFAULT_SIZE);

//TODO 支持submit()Runnable,Callable 参看Lambda
    @PreDestroy
    public void destroy(){
        executorService.shutdown();
    }


/*
TODO String.format("delete  from  n_order%s where order_id  in (%s);",12,21)
TODO String类的方法，替换替代符操作！！
 */

}
